import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    { path: '/', redirect: '/front/home' },
    {
      path: '/front',
      component: () => import('@/views/Front.vue'),
      children: [
        { path: 'home', component: () => import('@/views/front/Home.vue'),  },
        { path: 'person', component: () => import('@/views/front/Person.vue'),  },
        { path: 'password', component: () => import('@/views/front/Password.vue'),  },
        { path: 'bookDetail', component: () => import('@/views/front/BookDetail.vue'),  },
        { path: 'orders', component: () => import('@/views/front/Orders.vue'),  },
        { path: 'cart', component: () => import('@/views/front/Cart.vue'),  },
        { path: 'posts', component: () => import('@/views/front/Posts.vue'),  },
        { path: 'postsDetail', component: () => import('@/views/front/PostsDetail.vue'),  },
        { path: 'myPosts', component: () => import('@/views/front/MyPosts.vue'),  },
        { path: 'activity', component: () => import('@/views/front/Activity.vue'),  },
        { path: 'activityDetail', component: () => import('@/views/front/ActivityDetail.vue'),  },
        { path: 'sign', component: () => import('@/views/front/Sign.vue'),  },
        { path: 'collect', component: () => import('@/views/front/Collect.vue'),  },
        { path: 'book', component: () => import('@/views/front/Book.vue'),  },
        { path: 'room', component: () => import('@/views/front/Room.vue'),  },
        { path: 'seatReserve', component: () => import('@/views/front/SeatReserve.vue'),  },
        { path: 'mySeatReserve', component: () => import('@/views/front/MySeatReserve.vue'),  },
      ]
    },
    { path: '/404', component: () => import('@/views/404.vue') },
    { path: '/:pathMatch(.*)', redirect: '/404' }
  ]
})

export default router
